﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kindohm.Life.Library
{
    public class PlantFinder : ProximityFinder
    {
        public Plant FindIdealPlant(Board board, Point start, int maxRange)
        {
            BoardObject item = this.FindNearestItem<BoardObject>(board, start, maxRange);
            Plant food = item as Plant;
            return food;
        }
    
        protected override bool ObjectIsValid<T>(T item)
        {
            Plant plant = item as Plant;
            if (plant != null && plant.Nutrition > 0)
            {
                return true;
            }
            return false;
        }
    }
}
